import { defineConfig } from '@rsbuild/core';
import { pluginVue } from '@rsbuild/plugin-vue';
import path from 'path';

export default defineConfig({
    plugins: [pluginVue()],
    source: {
        entry: {
            index: './src/main.ts'
        },
        define: {
            'process.env.API_URL': JSON.stringify(process.env.API_URL)
        }
    },
    resolve: {
        alias: {
          '@': path.resolve(__dirname, 'src')
        },
    },    
    dev: {
        // port 和 historyApiFallback 在新版本中可能不支持，移除这些配置
        // 如果需要配置这些选项，可能需要查看最新的 rsbuild 文档
    },
    html: {
        title: 'Xavvi Topip',
        favicon: './public/favicon.ico',
        mountId: 'app'
    },
    output: {
        distPath: {
            root: 'dist',
            js: 'assets/js',
            css: 'assets/css',
            media: 'assets/media'
        },
        filenameHash: true,
        assetPrefix: '/',
        cssModules: {
            exportLocalsConvention: 'camelCaseOnly'
        }
    }
}); 